Open
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Collaborator
Author
|
Things still to do:
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #296 +/- ##
==========================================
+ Coverage 59.58% 61.60% +2.01%
==========================================
Files 35 34 -1
Lines 6164 5949 -215
==========================================
- Hits 3673 3665 -8
+ Misses 2491 2284 -207
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Collaborator
Author
|
Current workflow is:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The current version of MapReader contains unused/untested code for using the patch context when training the model. From the 2021 paper:
"Context-aware patchwork method.

A limitation of the patchwork method is that it ignores neighboring patches when training or performing model inference. To capture the strong, spatial dependencies between neighboring patches (which will be common in maps for many types of labels [16]), MapReader supports building model ensembles as shown in Fig. 8. Model-1 and Model-2 are two CV models with neural network architectures defined by the user. These models can have different or similar architectures. For exam- ple, in one of our experiments, Model-2 was a pre-trained model on our patch dataset while Model-1 was a pre-trained model from PyTorch Image Models [40] with a different architecture. As shown in Fig. 8, a patch and its context image are fed into Model-2 and Model-1, respectively. In practice, the user only specifies the size of the context image, and MapReader extracts and preprocesses the context image from the dataset. Model-1 and Model-2 generate vector representations for the input images, V1 and V2. The size of these vectors are defined by the user and a combination of the two (e.g., by concatenation) is then fed into Model-3 for prediction. Such model ensembles can be an efficient approach to achieving high- performing CV models [37]."
This PR updates this code to be more simple/user-friendly.
Fixes #287
Addresses #17
Describe your changes
PatchDatasetandPatchContextDatasetreturn image(s) as tuples. These datasets now return(img,)and(img, context_img)respectively.context_datasetarg when creating datasets to enable creating of 'PatchContextDataset' type datasets from the annotations loader.twoParrellelModelsclass to clarify patch/context branches of the modelgenerate_layerwise_lrsmethod for context datasetsChecklist before assigning a reviewer (update as needed)
Reviewer checklist
Please add anything you want reviewers to specifically focus/comment on.